package com.xbk.util;

import java.util.ArrayList;
import java.util.List;

import com.xbk.platform.DataMap;

public class CollectionUtil {
	
	public static String getDMString(List<DataMap> results,String name){
		String reValue = "";
		for (int i = 0; i < results.size(); i++) {
			if(i != 0) reValue += ",";
			reValue += results.get(i).getString(name);
		}
		return reValue;
	}
	
	
	public static ArrayList<String> initByString(String data){
		ArrayList<String> list = new ArrayList<String>();
		String[] dd = null;
		if(StringUtil.notNull(data)) {
			dd = data.split(",");
			for (String d : dd) {
				list.add(d);
			}
		}
		return list;
	}
	
	public static ArrayList<String> initByString(String[] data){
		ArrayList<String> list = new ArrayList<String>();
		for (String d : data) {
			list.add(d);
		}
		return list;
	}
	
	public static String getString(List<String> list,String separate){
		String sReturn = "";
		for (int i = 0; i < list.size(); i++) {
			if(i > 0) sReturn += StringUtil.isNull(separate) ? "," : separate;
			sReturn += list.get(i);
		}
		return sReturn;
	}
	
	public static void main(String[] args) {
		int a = 10;
		int b = 10;
		System.out.println(a==b);
	}
}
